package com.jirefox.loner.runtime.initialize;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import groovy.util.GroovyScriptEngine;

@Configuration
public class EngineConfig {

	@Value("${loner.appDir}")
	private String appDir;

	@Bean("groovyScriptEngine")
	public GroovyScriptEngine groovyScriptEngine() throws IOException {
		GroovyScriptEngine groovyScriptEngine = new GroovyScriptEngine(appDir + "/scripts");
		return groovyScriptEngine;
	}

}
